home *** CD-ROM | disk | FTP | other *** search
- //========================================================================================
- //
- // Exploder description for 'FWmb' (ODF menu bar) resources
- //
- // Author: Steve Crutchfield
- //
- // Copyright: (c) 1996 by Apple Computer, Inc., all rights reserved.
- //
- // The EDL and VDL code describing this resource type rely heavily
- // on the use of class labels (four-character codes) used by
- // ODF's archiver. However, the base MenuBar object is not
- // archivable and thus has no class label. In order to preserve
- // the symmetry required by ResEdit's recursive "SELF" command,
- // a dummy class label ('root') is inserted at the top level of
- // the menu hierarchy by a plug-in command.
- //
- //========================================================================================
-
- ArchivableHeader(); // custom plugin routine--adds 10 bytes including 'root' tag
- // to top level of hierarchy
-
- Define(FW_RArchivableObject)
- {
- Word(fClassTag);
- Long(fClassID);
- Long(fLabel);
- Word(fObjectTag);
- Long(fObjectID);
- }
-
- Define(FW_RStringData)
- {
- Word(fScriptCode);
- Word(fLanguageCode);
- String(fTitle, LengthWord);
- }
-
- Define(FW_RMenuItem)
- {
- Word(fIndex);
- PadWord();
- Long(fOwnerMenuClass);
- PadWord();
- Long(fOwnerMenuID);
- }
-
- Define(FW_RSeparatorItem)
- {
- Call(FW_RMenuItem);
- }
-
- Define(FW_RTextItem)
- {
- Call(FW_RMenuItem);
-
- Long(fCommandID);
- Word(fMenuKey);
-
- Call(FW_RStringData);
- }
-
- Define(FW_RToggleItem)
- {
- Call(FW_RTextItem);
-
- // Using a list here is a workaround. A better solution would
- // be to use an Element(); however, there is no structure in
- // VDL which causes all identifiers within its scope to
- // apply to a sub-element rather than the containing element.
- // DynamicVList performs this task for a list, so we use a
- // single-element list here. This is needed because both
- // strings in a toggle item contain script and language
- // code fields, which must have the same name in each case so
- // that a single VDL named statement can be used to generate all
- // script/language code popup menus.
-
- List(fAlternateItem, MenuItem, 1)
- {
- Word(fScriptCode);
- Word(fLanguageCode);
- String(fTitle, LengthWord);
- }
- }
-
- Define(FW_RSubMenuItem)
- {
- Call(FW_RMenuItem);
-
- // Use of List is a workaround; see comment above.
-
- List(fSubMenu, SubMenu, 1)
- SELF; // submenu contains a pull-down menu ('pdmn')
- }
-
- Switch(fLabel)
- {
- case 'root':
- {
- // Un-comment the next line if you're using ODF 2.
- // Call(FW_RStringData);
-
- List(fMenus, Menu, OneBasedCount(16))
- SELF; // root level contains list of pull-down menus
- }
-
- case 'pdmn':
- {
- Word(fObjectTag);
- Long(fObjectID);
-
- Call(FW_RStringData);
-
- List(fItems, Item, OneBasedCount(16))
- {
- Call(FW_RArchivableObject);
-
- Switch(fLabel)
- {
- case 'txit':
- {
- Call(FW_RTextItem);
- }
-
- case 'tgit':
- {
- Call(FW_RToggleItem);
- }
-
- case 'seit':
- {
- Call(FW_RSeparatorItem);
- }
-
- case 'suit':
- {
- Call(FW_RSubMenuItem);
- }
- }
- }
- }
- }
-